<?php
include("../inc/global.inc");
include("../steps.php");
$url=$_SERVER['HTTP_REFERER'];
if($_POST[act]){

@mysql_query("update job_per_search set p_class_1='$_POST[job_class]',p_class_2='$_POST[job_smill]',p_hy='$_POST[job_hy]',p_pro='$_POST[c_provinces4]',p_city='$_POST[c_city4]',p_nature='$_POST[p_nature]',p_salary='$_POST[p_salary]',p_exp='$_POST[p_exp]',p_exp='$_POST[p_edu]',p_edu='$_POST[p_edu]',p_title='$_POST[keywords]',p_date='$_POST[p_date]' where id='".$_POST['iid']."'");

echo "<script>alert('修改成功');location='".$url."';</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜索器修改-我的搜索器-三帝招聘网</title>
<link href="../css/body.css" rel="stylesheet" type="text/css"/>
<link href="../css/link.css" rel="stylesheet" type="text/css"/>
<link href="css/head.css" rel="stylesheet" type="text/css"/>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
<link href="../css/foot.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://www.sandib2b.cn/js/job_class.js" charset="gb2312"></script>
<script type="text/javascript" src="http://www.sandib2b.cn/js/city.js" charset="gb2312"></script>
</head>
<body>
<?php include("../inc/top.php");?>
<div class="menuBox1">
<a href="/member/">管理中心</a>
<a href="/member/show.php">我的简历</a>
<a href="/member/search_manage.php">我的搜索器</a>
<a href="/member/favorites.php">收藏夹</a>
<a href="/member/cqjob.php">发件夹</a>
<a href="/member/inbox.php">收件夹</a>
<div class="onl"></div>
</div>
<div id="mian">
<div class="rightmain">
<?php include("right_s.php")?>

</div>
<div id="box">
  <div class="JobBox sideyellow backyellow">
<div class="mian_Co">
  <div class="title size14 topside6"><strong>添加搜索</strong></div>
 <?php $s_rs=@mysql_query("select * from job_per_search where member_id='$_COOKIE[job_user_id]' and id='".$_GET['id']."'");
       $s_row=@mysql_fetch_array($s_rs);
 ?>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
  <form id="form1" name="form1" method="post" action="" onsubmit="return checkform()">
    <tbody>
      <tr>
        <td height="25" colspan="4" align="left">　选择职位类别、行业类别、工作地区、或关键字，请至少选择其一！ </td>
        </tr>
      <tr>
        <td width="10%" height="25" align="right">职位类别：</td>
        <td width="50%" align="left">
		  <select name="job_class" id="job_class" onChange="changejobtype(document.form1.job_class.options[document.form1.job_class.selectedIndex].value)" style="width:160px;">
                              <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select * from job_class  where j_c_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>" <?php if($s_row[p_class_1]==$row['id']){echo "selected";}?>><?=$row[j_c_name]?></option>
							  <?php }?>
                  </select>&nbsp;&nbsp;<select name="job_smill" id="job_smill" style="width:160px;">
                              <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select * from job_class where j_c_id='$s_row[p_class_1]'");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>" <?php if($s_row[p_class_2]==$row['id']){echo "selected";}?>><?=$row[j_c_name]?></option>
							  <?php }?>
			    </select></td>
        <td width="10%" align="center">行业类别：</td>
        <td width="30%"><select name="job_hy" id="job_hy" style="width:160px;">
                            <option value="">选择、修改</option>
							  <?php
							     $rs=@mysql_query("select * from job_hy where job_hy_id=0");
								 while($row=@mysql_fetch_array($rs)){
							  ?><option value="<?=$row['id']?>" <?php if($s_row[p_hy]==$row['id']){echo "selected";}?>><?=$row[job_hy_name]?></option>
							  <?php }?>
                </select></td>
      </tr>
      <tr>
        <td height="25" align="right">工作地点：</td>
        <td align="left"><select  name="c_provinces4" id="c_provinces4" onChange="changecity4(document.form1.c_provinces4.options[document.form1.c_provinces4.selectedIndex].value)" style="width:80px;">
            <option value="">省份</option>
          <?php
          $result = mysql_query("select * from city where city_id=0");    
          while($res = mysql_fetch_array($result)){    
          ?>    
          <option value="<?=$res['id']?>" <?php if($s_row[p_pro]==$res[id]){echo "selected";}?>><?=$res['city_name']?></option> 
          <?php }?>   
       </select>
       <select name="c_city4" id="c_city4" onChange="changecity5(document.form1.c_city4.options[document.form1.c_city4.selectedIndex].value)" style="width:80px;">
            <option value="">城市</option>
		<?php
          $result = mysql_query("select * from city where id='$s_row[p_city]'");    
          while($res = mysql_fetch_array($result)){    
          ?> 
		  <option value="<?=$res['id']?>" selected><?=$res['city_name']?></option> 
          <?php }?>
       </select></td>
        <td align="center">发布日期：</td>
        <td><select name="p_date" style="width: 70%;">
          <option value="0">不限</option>
		  <option value="1" <?php if($s_row[p_date]==1){echo "selected";}?>>近1天</option>
		  <option value="3" <?php if($s_row[p_date]==3){echo "selected";}?>>近3天</option>
		  <option value="7" <?php if($s_row[p_date]==7){echo "selected";}?>>近7天</option>
		  <option value="15" <?php if($s_row[p_date]==15){echo "selected";}?>>近15天</option>
		  <option value="20" <?php if($s_row[p_date]==20){echo "selected";}?>>近20天</option>
		  <option value="30" <?php if($s_row[p_date]==30){echo "selected";}?>>近30天 </option>
        </select></td>
      </tr>   
      <tr>
        <td height="25" align="right">工作性质：</td>
        <td align="left">
		<input id="p_nature" type="radio" value="1" <?php if($s_row[p_nature]==1){echo "checked";}?> name="p_nature" />全职
        <input id="p_nature" type="radio" value="2" <?php if($s_row[p_nature]==2){echo "checked";}?> name="p_nature" />兼职
        <input id="p_nature" type="radio" value="3" <?php if($s_row[p_nature]==3){echo "checked";}?> name="p_nature" />实习</td>
        <td align="center">月薪范围：</td>
        <td align="left"><select id="p_salary" name="p_salary">
            <option value="1">面谈</option>
            <option value="2" <?php if($s_row[p_salary]==2){echo "selected";}?>>1000元/月以下</option>
            <option value="3" <?php if($s_row[p_salary]==3){echo "selected";}?>>1000-2000元/月</option>
            <option value="4" <?php if($s_row[p_salary]==4){echo "selected";}?>>2001-4000元/月</option>
            <option value="5" <?php if($s_row[p_salary]==5){echo "selected";}?>>4001-6000元/月</option>
            <option value="6" <?php if($s_row[p_salary]==6){echo "selected";}?>>6001-8000元/月</option>
            <option value="7" <?php if($s_row[p_salary]==7){echo "selected";}?>>8001-10000元/月</option>
            <option value="8" <?php if($s_row[p_salary]==8){echo "selected";}?>>10001-15000元/月</option>
            <option value="9" <?php if($s_row[p_salary]==9){echo "selected";}?>>15000-25000元/月</option>
            <option value="10" <?php if($s_row[p_salary]==10){echo "selected";}?>>25000元/月以上</option>
        </select></td>
      </tr>
      <tr>
        <td height="25" align="right">工作经验：</td>
        <td align="left"><select id="p_exp" name="p_exp">
            <option value="1" selected="selected">无</option>
            <option value="2" <?php if($s_row[p_exp]==2){echo "selected";}?>>1年以下</option>
            <option value="3" <?php if($s_row[p_exp]==3){echo "selected";}?>>1-2年</option>
            <option value="4" <?php if($s_row[p_exp]==4){echo "selected";}?>>3-5年</option>
            <option value="5" <?php if($s_row[p_exp]==5){echo "selected";}?>>6-7年</option>
            <option value="6" <?php if($s_row[p_exp]==6){echo "selected";}?>>8-10年</option>
            <option value="7" <?php if($s_row[p_exp]==7){echo "selected";}?>>10年以上</option>
        </select></td>
        <td align="center">学　　历：</td>
        <td align="left"><select name="p_edu">
            <option value="1" >不限</option>
            <option value="2" <?php if($s_row[p_edu]==2){echo "selected";}?>>高中及高中以下</option>
            <option value="3" <?php if($s_row[p_edu]==3){echo "selected";}?>>技校</option>
            <option value="4" <?php if($s_row[p_edu]==4){echo "selected";}?>>中专</option>
            <option value="5" <?php if($s_row[p_edu]==4){echo "selected";}?>>大专</option>
            <option value="6" <?php if($s_row[p_edu]==6){echo "selected";}?>>本科</option>
            <option value="7" <?php if($s_row[p_edu]==7){echo "selected";}?>>硕士</option>
            <option value="8" <?php if($s_row[p_edu]==8){echo "selected";}?>>博士及以上</option>
        </select></td>
      </tr>
      <tr>
        <td height="25" align="right">搜索器名：</td>
        <td><input name="keywords" type="text" value="<?=$s_row[p_title]?>" size="20" maxlength="100"/></td>
        <td align="center">&nbsp;</td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr><input type="hidden" name="iid" value="<?=$s_row[id]?>" />
        <td height="25" align="right">&nbsp;</td>
        <td align="left"><input type="hidden" name="act" value="job.sandib2b.cn" /><input name="Submit" type="submit" class="inputbut" value=" 保 存 " /></td>
        <td align="center">&nbsp;</td>
        <td align="left">&nbsp;</td>
      </tr>
      <tr>
        <td height="25" align="right">&nbsp;</td>
        <td>&nbsp;</td>
        <td align="center">&nbsp;</td>
        <td align="center">&nbsp;</td>
		</tr>
		<tr>
		  <td height="43" align="right">&nbsp;</td>
		  <td><label></label></td>
		  <td align="center">&nbsp;</td>
		  <td align="center">&nbsp;</td>
		  </tr>
		<tr>
		  <td height="25" align="right">&nbsp;</td>
		  <td>&nbsp;</td>
		  <td align="center">&nbsp;</td>
		  <td align="center">&nbsp;</td>
		  </tr>
    </tbody></form>
  </table>
</div>
</div>
<div class="onl"></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
</div>
<?php include("../inc/foot.php");?>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
if($("job_class").value==""){
alert("请选择职位");
$("job_class").focus();
return false;
}
if($("job_smill").value==""){
alert("请选择职位");
$("job_smill").focus();
return false;
}
if($("job_hy").value==""){
alert("请选择行业");
$("job_hy").focus();
return false;
}
if($("c_provinces4").value==""){
alert("请选择省份");
$("c_provinces4").focus();
return false;
}
if($("c_city4").value==""){
alert("请选择城市");
$("c_city4").focus();
return false;
}

if($("keywords").value==""){
alert("搜索器名不能为空");
$("keywords").focus();
return false;
}
}
</script>